<!DOCTYPE html>
<html>
<title>基础教程(cainiaojc.com)</title>
<body>

<h1 id="demo"> HTML DOM样式属性</h1>

<p>单击按钮可为H1元素添加颜色：</p>

<button onclick="myFunc()">Click</button>

<script>
    function myFunc() {
        document.getElementById("demo").style.color = "blue";
    }
</script>

</body>
</html>